package com.swi.service.consume.impl;

import com.base.dto.PageContent;
import com.swi.dao.consume.CustInfoMapper;
import com.swi.entity.consume.CustInfo;
import com.swi.service.consume.ICustInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Shisan on 2017/8/25.
 */
@Service
public class CustInfoServiceImpl implements ICustInfoService{

    @Autowired
    private CustInfoMapper custInfoMapper;

    @Override
    @Transactional(readOnly = false)
    public int deleteByPrimaryKey(String id) {
        return custInfoMapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional(readOnly = false)
    public int insert(CustInfo record) {
        return custInfoMapper.insert(record);
    }

    @Override
    @Transactional(readOnly = false)
    public int insertSelective(CustInfo record) {
        return custInfoMapper.insert(record);
    }

    @Override
    @Transactional(readOnly = true)
    public CustInfo selectByPrimaryKey(String id) {
        return custInfoMapper.selectByPrimaryKey(id);
    }

    @Override
    @Transactional(readOnly = true)
    public PageContent selectByPage(PageContent page) {
        page.setResultData(custInfoMapper.selectByParam(page.getParam()));
        return page;
    }

    @Override
    @Transactional(readOnly = false)
    public int updateByPrimaryKeySelective(CustInfo record) {
        return custInfoMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional(readOnly = false)
    public int updateByPrimaryKey(CustInfo record) {
        return updateByPrimaryKey(record);
    }
}
